package 传智播客_黑马.java高级.多线程;

public class 创建线程的方法 {
    //继承Thread类
    class One_Thread extends Thread{
        @Override
        public void run() {
            System.out.println("Thread成功");
        }
    }

    //实现Runnable接口
    class Two_Runnable implements Runnable{
        @Override
        public void run() {
            System.out.println("runable成功");
        }
    }


    public static void main(String[] args) {
//        One_Thread one_thread = new One_Thread();
        //匿名内部类方式实现线程的创建 匿名内部类没有构造方法
        new Thread(){
            @Override
            public void run() {


            }
        }.start();

        new Thread(new Runnable(){

            @Override
            public void run() {

            }
        }).start();


    }
}
